feat(main): Support Go AutoMemLimit#7080
Open
aryanxgupta wants to merge 1 commit intocortexproject:masterfrom
Open
feat(main): Support Go AutoMemLimit#7080aryanxgupta wants to merge 1 commit intocortexproject:masterfrom
aryanxgupta wants to merge 1 commit intocortexproject:masterfrom
Conversation
Signed-off-by: aryanxgupta <itss.aryan@gmail.com>
yeya24
reviewed
Nov 2, 2025
Contributor
yeya24
left a comment
There was a problem hiding this comment.
Thanks @aryanxgupta. I think this approach works but this behavior should be behind a feature flag, similar to what Prometheus does. We need a flag to enable auto memlimit and another flag to set auto memlimit ratio.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Hi,
This PR implements the
automemlimitfeature requested in issue #7064.I've followed the Prometheus implementation as a reference, adding the simple
SetGoMemLimitWithOptscall at the start ofcmd/cortex/main.goand using the project's logger. I did not add the complex flag/config logic which was mentioned in the reference PR.Note on Tests:
I ran
make testlocally. The build succeeded and the tests forcmd/cortexpassed. However, the test run failed inpkg/alertmanagerandpkg/compactor. These appear to be unrelated, so I'm relying on the CI to run the full suite.Which issue(s) this PR fixes:
Fixes #7064
Checklist
CHANGELOG.mdupdated - I'm not sure if a changelog entry is needed for this. Please let me know if I should add one